
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>用户添加-用户管理</title>
  </head>

  <body>
    <div id="app">
      <div class="wrapper">
        <!-- 顶部导航 -->
        <nav class="app-header">
          <button type="button" class="btn btn-danger btn-sm">退出登陆</button>
        </nav>

        <!-- 内容容器 -->
        <div class="content-header">
          <div class="container-fluid">
            <div class="row mb-2">
              <div class="col-sm-6">
                <h1 class="m-0">用户新增 / 修改</h1>
              </div>
            </div>
          </div>
        </div>

        <!-- 内容区 -->
        <div class="content">
          <div class="container-fluid">
            <div class="card">
              <!-- 可以使用form表单提交 发起请求 但是多数情况用ajax请求 -->
              <form id="addForm" action="http://localhost:8081/admin/user" method="post" enctype="multipart/form-data">
                <div class="card-body">
                  <div class="form-group">
                    <label>用户名</label>
                    <input type="text" class="form-control" id="username" name="username" />
                  </div>
                  <div class="form-group">
                    <label>密码</label>
                    <input type="password" class="form-control" name="pwd" id="pwd"/>
                  </div>
                  <div class="form-group">
                    <label for="profile">头像</label>
                    <div class="input-group">
                      <div class="custom-file">
                        <!-- 限制选择文件类型只能是图片 -->
                        <input type="file" id="profile" name="profileFile" accept="image/png,image/jpeg"/ />
                        <label class="custom-file-label" for="profile"
                          >点击选择头像</label
                        >
                      </div>
                    </div>
                    <div class="h-20"></div>
                    <img id="preview" width="80" alt="">
                  </div>
                </div>
                <div class="card-footer">
                  <button type="submit" class="btn btn-primary">
                    新增用户
                  </button>
                </div>
              </form>
            </div>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>
